<?php
include_once("../modules/checkA.php");
include_once("../../config.php");
$plate=select_one_line_all_items($table_Prefix."plate","mid = 'case'");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];

if(!$_REQUEST ['applydate'])
{
    $_REQUEST ['applydate']=date("Y-m");
}
$applydate  = addslashes($_REQUEST ['applydate']);

//include_once("collect-function.php");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head>
    <?php include_once(ROOT_PATH_.'/controlbase/modules/head.php'); ?>



    <style>
        body>.detail-staitics-info .agent-list li{font-size: 12px!important; width:100px;}
        body>.detail-staitics-info .layui-table td, .layui-table th{font-size: 12px!important;}
    </style>



    <script language="javascript">
        function printdiv(printpage)
        {
            var newstr = printpage.innerHTML;
            var oldstr = document.body.innerHTML;
            document.body.innerHTML =newstr;
            window.print();
            document.body.innerHTML=oldstr;
            return false;
        }



        function print_btn()
        {
            var bt=document.getElementById("bt");
            var div_print=document.getElementById("div_print");

            printdiv(div_print);

        }

    </script>





</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controlbase/modules/topbar.php'; ?></div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controlbase/modules/sidebar.php'; ?>
        </div>




        <div id="content">
            <h1>项目统计信息</h1>





            <!-- 用$system_part .list_boxes来控制来到确认板块信息显示-->
            <div class="list-box">







<div class="list-boxes layui-form">



<!--按照项目类型来分-->


                                        <table class="layui-table">
                                            <colgroup>
                                                <col width="60">
                                                <col width="100">
                                                <col >
                                                <col width="120">
                                                <col >
                                                <col >
                                                <col >
                                                <col >
                                                <col >
                                                <col >
                                                <col >
                                                <col >
                                                <col width="550">

                                            </colgroup>
                                            <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>接单数</th>
                                                <th>接单额</th>
                                                <th>完成项目数</th>
                                                <th>完成项目金额</th>
                                                <th>类型1接单</th>
                                                <th>类型1金额</th>
                                                <th>类型1完成金额</th>
                                                <th>付款方式</th>
                                                <th>网点</th>
                                            </tr>
                                            </thead>
                                            <tbody>


                                            出个表格，统计每个月接单的数量，每个月完成的数量，每个月每个项目的类型，每个月收到的金额

                                            项目介绍人的统计



                                        <?php
                                        for ($ii = 0; $ii < count($detail); $ii++) {
                                            ?>

                                            <tr <?if($applymodify['nid']){echo "style='color:red'";$status="审核中";}else{$status="正常";}?>>
                                                <td><?echo $ii+1 ?></td>
                                                <td><?echo $detail[$ii]['name']?></td>
                                                <td><?echo $detail[$ii]['mid']?></td>
                                                <td><?echo substr($detail[$ii]['applydate'],0,10)?></td>
                                                <td><?echo $detail[$ii]['license']?></td>
                                                <td><?echo $detail[$ii]['cost']?> </td>
                                                <td><?echo $detail[$ii]['status']?> </td>
                                                <td><?echo $detail[$ii]['payment']?> </td>


                                                <?$department=select_one_line_all_items($table_Prefix."department","nid = '".$detail[$ii]['departmentid']."'");?>
                                                <?$agent=select_one_line_all_items($table_Prefix."employee","nid = '".$detail[$ii]['agentid']."'");?>
                                                <?$coach=select_one_line_all_items($table_Prefix."employee","nid = '".$detail[$ii]['coachid']."'");?>
                                                <td><?echo $department['name'] ?></td>

                                            </tr>



<? $sum_cost[$ii]=$detail[$ii]['cost']?>

                                            <?php
                                        ;}
                                        ?>

                                        <tr>
                                            <td> </td>
                                            <td> </td>
                                            <td> </td>
                                            <td> </td>
                                            <td> </td>
                                            <td>总金额：<? echo array_sum($sum_cost)?></td>
                                            <td> </td>
                                            <td> </td>
                                            <td>报名人数：<?echo count($detail)?></td>
                                        </tr>

                        </tbody>
                    </table>

   




















</div>


                <!--list-box end-->
            </div>

            <!--content端點01-->
        </div>
        <!--maincontent端點01-->
        <br class="clearfloat"/>
    </div>
    <!--container端點01-->
</div>









<?php include_once('../modules/footer.php'); ?> </body>
</html>
